package modele;

import java.awt.Point;

public class Element {
    
    private int x;
    private int y;
    private int height;
    private int width;
    private int vitesse;
    private int dirX = 1;
    private int dirY = 1;
    
    public Element() {
        super();
    }

    public Element(int x, int y){
        super();
        this.x = x;
        this.y = y;
    }
    
    public Point GetCoordonnees() {
        Point p = new Point(x,y);
        return p;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void Avancer(int largeurCadre, int hauteurCadre) {
        if (x < rayon) {
            dirX = 1;
        }
        if (x > largeurCadre - rayon) {
            dirX = -1;
        }
        if (y < rayon) {
            dirY = 1;
        }
        if (y > hauteurCadre - rayon) {
            dirY = -1;
        }

        x += vitesse * dirX;
        y += vitesse * dirY;
        return;
    }
    
}
